Implement “remove tenant with delayed email”
Repo: · Issue: #90 Status: Open · Priority: P2 Assignee: Unassigned
Description
Caused by https://twill-network.slack.com/archives/C06UCQP1BFC/p1724952079704339. Also see https://twill-network.slack.com/archives/C06UCQP1BFC/p1724957607118299?thread_ts=1724952079.704339&cid=C06UCQP1BFC in it.
Related/Probably would be covered by https://github.com/Twill-AI/facade/issues/109.
“Delete Organization/Tenant” action is a negative event for the app we need to have ability to mitigate it somehow. Until Deactivate Organization/Tenant feature is implemented we want to have following behavior:
- When user presses “Delete Organization” he should get “Email with a link to remove would be sent to your email within 24 hours”.
- Send email about this event to mike@twillpayments.com to allow him reach out to this user, ask what was wrong (gather feedback) and try to return it back.
- After 20 hours send email with a link to remove tenant.
AC:
- “Send email” feature is implemented. Not through the Supabase (i.e. need in a separate integration).
- “Call API by link” API is implemented. It should be secure enough because link in the email would be completely open, without TLS encryption. Probably the same flow as WebSocket tickets but with persisting to database and longer TTL (few hours).
- “Trigger account delete” API to send email to admin and schedule a cron task to send link after 20 hours. Due to replica may be replaced in this time cron task should be persisted in database.
Implementation Notes
Dash adds notes here while working
Related
Link to people, meetings, dependent tickets